import axios from 'axios'

import store from '../store/index'

const instance = axios.create({
    // baseURL: "/demo",
    baseURL: process.env.VUE_APP_BASE_API,

    timeout: 3000,
})
instance.interceptors.request.use((config) => {
    
    // const token = store.state.user.userInfo.token
    // if(token){
    //     config.headers['X-auth-token'] = token
    // }
    return config
},err => {
    console.log(err)
})
  
  
instance.interceptors.response.use((res) => {
    
    return res.data
},err => {
    console.log(err)
})


console.log(process.env.VUE_APP_BASE_API)


export default instance
